package com.chris.libs.example.api;

import com.chris.dev.base.libs.v1.http.params.IdParam;
import com.chris.dev.base.libs.v1.http.protocols.HttpResult;
import com.chris.libs.example.common.http.DefaultRetrofit;
import com.chris.libs.example.model.results.UserInfo;
import com.chris.libs.http.x.v1.NetApi;

import java.util.List;

import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;

/**
 * @author Chris chan
 * Create on： 2025/2/3 18:37
 * Use for:
 * Explain:
 */
public class UserApi extends NetApi {
    public static Service service = DefaultRetrofit.create("user/", Service.class);


//    public static void getUserInfo(IdParam<Integer> params, NetCallback<NetResult<UserInfo>> callback) {
//        String token = "Barer nfhdidhsihfiuhqohoghjowhgeq";
//        RequestBody requestBody = postRequestObjBody(null, params);
//        service.getUserInfo(token, requestBody).enqueue(callback);
//    }

    public interface Service {
        @POST("getUserInfo")
            //Call<NetResult<UserInfo>> getUserInfo(@Header("Authorization") String token, @Body RequestBody body);
        Call<HttpResult<UserInfo>> getUserInfo(@Body RequestBody body);

        @POST("getDataList")
        Call<HttpResult<List<UserInfo>>> getDataList(@Body IdParam<String> params);
    }
}
